// 全角转半角
export function toHalfWidth(str: string | null | undefined): string {
  if (!str) return str || '';

  return str.replace(/[\uFF01-\uFF5E]/g, (ch: string) => String.fromCharCode(ch.charCodeAt(0) - 0xfee0)).replace(/\u3000/g, ' ');
}
